package com.wh.order.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.wh.order.pojo.OrderReviewer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.time.LocalDateTime;
import java.util.List;

/**
* 后端Service接口；
*/
@Mapper
@Repository
public interface OrderReviewerMapper extends BaseMapper<OrderReviewer> {

    /**
     * 分页：查询当前页数据
     * @param page 分页参数
     * @param queryWrapper 查询条件
     * @return
     */
    List<OrderReviewer> findByPage(@Param("page") IPage<OrderReviewer> page,@Param("ew") QueryWrapper<OrderReviewer> queryWrapper);

    /**
     * 初审
     * @param examineTime
     * @param orderSn
     * @param reviewer
     * @param juniorReviewerNotes
     */
    void firstExamine(@Param("examineTime") LocalDateTime examineTime,
                      @Param("orderSn") String orderSn,
                      @Param("reviewer") Integer reviewer,
                      @Param("juniorReviewerNotes") String juniorReviewerNotes);

    void secondExamine(Integer reviewer, LocalDateTime examineTime, String intermediateReviewerNotes, String orderSn);

    void finalExamine(String orderSn, String finalReviewerNotes, LocalDateTime examineTime);
}
